A compiler generates an object code by reading and optimizing a source code described in a programming language. In the compiler, loop fusion is utilized as an optimization technique to improve data locality, reduce the cost required for repeating determination processing for loops, and speed up the execution performance. The loop fusion is executed by fusing the loops in the case where an initial value, a final value, and an incremental value of the adjacent loops are identical and dependency between the loops does not collapse when the loops are fused, thereby reducing the number of determination times for a multiple-loop processing structure existing inside a source program.
Patent Literature 1: Japanese Laid-open Patent Publication No. 09-114675
Patent Literature 2: Japanese Laid-open Patent Publication No. 62-35944
Patent Literature 3: Japanese Laid-open Patent Publication No. 2009-104422
However, there may be a problem of causing data access latency or arithmetic processing latency after the loop fusion only with the above-described conditions of loop fusion, inducing ineffective loop fusion.
For instance, even when the loops are adjacent to each other and have the identical initial values, final values, incremental values, in the case of fusing the loops having number of data accesses more than operands, the data access latency occurs, thereby not improving the performance. In the same manner, in the case of fusing the loops having the operands more than the number of data accesses, the arithmetic processing latency occurs, thereby not improving the performance.